part of '../index.dart';

class IconButton extends StatelessWidget {
  const IconButton(this.icon, {super.key, this.onTap, this.color, this.child});
  final IconData icon;
  final VoidCallback? onTap;
  final Color? color;
  final Widget? child;

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        constraints: const BoxConstraints(
          minWidth: 60,
          minHeight: 60,
        ),
        padding: const EdgeInsets.all(10),
        decoration: BoxDecoration(
          color: color,
          borderRadius: BorderRadius.circular(99),
        ),
        child: child ?? Icon(icon, size: 40, color: Colors.white),
      ),
    );
  }
}
